#include <string.h>
#include <stdio.h>

/*
 * 对象的结构		P172
 */

class Base
{
	void demo(void);
	int a;
	int b;

	public:
		virtual void demo2(void)
		{
		
		}

		int c;
};

int main()
{
	Base base;

	base.c = 11;
}



#if 0
/*
 * intel
 */
0000000000001149 <main>:
    1149:	f3 0f 1e fa          	endbr64 
    114d:	55                   	push   %rbp
    114e:	48 89 e5             	mov    %rsp,%rbp		// rbp=rsp
    1151:	48 83 ec 20          	sub    $0x20,%rsp		// rsp-=0x20
    1155:	64 48 8b 04 25 28 00 	mov    %fs:0x28,%rax		// rax=fs:0x28
    115c:	00 00 
    115e:	48 89 45 f8          	mov    %rax,-0x8(%rbp)		// rbp-0x8=rax
    1162:	31 c0                	xor    %eax,%eax		// eax=0
    1164:	48 8d 45 e0          	lea    -0x20(%rbp),%rax		// rax=rbp-0x20
    1168:	48 89 c7             	mov    %rax,%rdi		// rdi=rax
    116b:	e8 32 00 00 00       	callq  11a2 <_ZN4BaseC1Ev>	// Base()
    1170:	c7 45 f0 0b 00 00 00 	movl   $0xb,-0x10(%rbp)		// rbp-0x10=0xb=11
    1177:	b8 00 00 00 00       	mov    $0x0,%eax		// eax=0
    117c:	48 8b 55 f8          	mov    -0x8(%rbp),%rdx		// rdx=rbp-0x8
    1180:	64 48 33 14 25 28 00 	xor    %fs:0x28,%rdx		// rdx^fs:0x28
    1187:	00 00 
    1189:	74 05                	je     1190 <main+0x47>
    118b:	e8 c0 fe ff ff       	callq  1050 <__stack_chk_fail@plt>
    1190:	c9                   	leaveq 
    1191:	c3                   	retq   

0000000000001192 <_ZN4Base5demo2Ev>:
    1192:	f3 0f 1e fa          	endbr64 
    1196:	55                   	push   %rbp
    1197:	48 89 e5             	mov    %rsp,%rbp
    119a:	48 89 7d f8          	mov    %rdi,-0x8(%rbp)		// rbp-0x8=rdi
    119e:	90                   	nop
    119f:	5d                   	pop    %rbp
    11a0:	c3                   	retq   
    11a1:	90                   	nop

00000000000011a2 <_ZN4BaseC1Ev>:
    11a2:	f3 0f 1e fa          	endbr64 
    11a6:	55                   	push   %rbp
    11a7:	48 89 e5             	mov    %rsp,%rbp
    11aa:	48 89 7d f8          	mov    %rdi,-0x8(%rbp)		// rbp-0x8=rdi
    11ae:	48 8d 15 eb 2b 00 00 	lea    0x2beb(%rip),%rdx        # 3da0 <_ZTV4Base+0x10> rdx=rip+0x2beb
    11b5:	48 8b 45 f8          	mov    -0x8(%rbp),%rax		// rax=rbp-0x8
    11b9:	48 89 10             	mov    %rdx,(%rax)		// (rax)=rdx
    11bc:	90                   	nop
    11bd:	5d                   	pop    %rbp
    11be:	c3                   	retq   
    11bf:	90                   	nop

/*
 * arm
 */
000000000040066c <main>:
  40066c:	a9bd7bfd 	stp	x29, x30, [sp, #-48]!
  400670:	910003fd 	mov	x29, sp
  400674:	910063a0 	add	x0, x29, #0x18			// x0=x29+0x18
  400678:	9400000b 	bl	4006a4 <_ZN4BaseC1Ev>		// Base()
  40067c:	52800160 	mov	w0, #0xb                   	// #11
  400680:	b9002ba0 	str	w0, [x29, #40]			// x29+40=11
  400684:	52800000 	mov	w0, #0x0                   	// #0
  400688:	a8c37bfd 	ldp	x29, x30, [sp], #48
  40068c:	d65f03c0 	ret

0000000000400690 <_ZN4Base5demo2Ev>:
  400690:	d10043ff 	sub	sp, sp, #0x10
  400694:	f90007e0 	str	x0, [sp, #8]
  400698:	d503201f 	nop
  40069c:	910043ff 	add	sp, sp, #0x10
  4006a0:	d65f03c0 	ret

00000000004006a4 <_ZN4BaseC1Ev>:
  4006a4:	d10043ff 	sub	sp, sp, #0x10
  4006a8:	f90007e0 	str	x0, [sp, #8]			// sp+8=x0
  4006ac:	90000000 	adrp	x0, 400000 <_init-0x508>	// x0=400000
  4006b0:	911e2001 	add	x1, x0, #0x788			// x1=400788
  4006b4:	f94007e0 	ldr	x0, [sp, #8]			// x0=sp+8
  4006b8:	f9000001 	str	x1, [x0]			// [x0]=x1
  4006bc:	d503201f 	nop
  4006c0:	910043ff 	add	sp, sp, #0x10
  4006c4:	d65f03c0 	ret


 #endif
